<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <link rel="stylesheet" href="js\layui-v2.5.6\layui\css\layui.css">
    <script src="js\layui-v2.5.6\layui\layui.js" type="text/javascript"></script>
    <script src="js\layui-v2.5.6\layui\layui.all.js"  type="text/javascript"></script>

</head>
<body>
<!--class="layui-hide"-->
<table id="demo" lay-filter="test"></table>
<script type="text/javascript">
    var table = layui.table;

    //执行渲染
    table.render({
        elem: '#demo' //指定原始表格元素选择器（推荐id选择器）
        ,height: 315 //容器高度
        ,cols: [[{checkbox: true, fixed: true},
            {field: 'bookId', title: 'id', width: 150, sort: true, fixed: true},
            {field: 'bookName', title: '书名', width: 150, sort: true, edit: true},
            {field: 'bookCount', title: '剩余数量', width: 150, sort: true, edit: true}]] //设置表头

    });
</script>
</body>
</html>